Sunday, May 29, 2005
Fast variance optimization
What is reweighting? Consider a set of particle positions obtained from sampling a wavefunction at a given set of parameters. The energy (and the variance of the energy) explicitly depends on the wavefunction parameters by the local energy formula, and implicitly through the particle positions determined by sampling the wavefunction. When optimizing, one would like to vary the parameters without going through all the trouble and expense of sampling new positions. Computing the energy (or variance) change due to the local energy piece is easy - just put the new parameters in and recalculate. Reweighting is the process of correcting the implicit dependence of the energy (or variance) on the wavefunction parameters.
N. D. Drummond and R. J. Needs describe a VMC optimization method in their paper, A variance-minimization scheme for optimizing Jastrow factors, that uses only the explicit dependence of the variance on the parameters (ie, they use the un-reweighted variance). They restrict their scheme to linear parameters in the Jastrow factor, and this makes the resulting parameter surface a quartic. Also, this scheme only requires a single sum over electron positions (the requisite factors can be accumulated during a single run), making the optimization step very fast.
Even though this scheme uses a less accurate approximation for the variance, it appears to give very good results. In fact, the resulting energies for a neon atom are better using the unreweighted variance for optimization than from using the more traditional reweighted variance.
Saturday, April 16, 2005
Solving science problems
What if we could design a language expressly for MC and QMC simulations - what would it look like? As a first step, let's put programming in the context of solving the whole problem.
Steps to solve a computational science problem
- Define the problem (ask the question)
- Write down the equations modeling the system under investigation
- Using mathematical transformations and approximations, reduce the equations to a solvable form (numerical analysis)
- Convert into a computer program and run it
- Undertake verification (are steps 2,3, and 4 correct) and validation (are step 1 and the approximations in step 2 correct)
Developing techniques for managing each of the steps would be a great help. Current programming languages only deal with step 4. Computer algebra systems (Mathematica, Maple, Maxima, etc) can help with steps 2 and 3, but don't really help in making the jump to a large scale program.
Currently the transformations from steps 2 through 4 are done by hand. I know I make many mistakes in this process. It would be a boon to my productivity if the computer could verify that all the minus signs and factors of 2 are correct.
The verification step often involves understanding the effects of various approximations in step 3. If the program is described as a series of transformations on the equations, hopefully changing the approximation would be a simple change to the equations, and the rest of the process would automatically generate a correct program. This would make it easier to test approximations.
This doesn't say much about the ideal programming language, but it does give some idea of the problem to be solved. I'll have more to say about the ideal programming language later.
Wednesday, April 13, 2005
Programming Language Notes
Guy Steele is also the principal investigator for the Programming Language Research group. On that page there is a paper titled Object-Oriented Units of Measurement. It's a look the issues involved in making units work in a Java-like OO language.
The last note is an ACM Queue article by Gregory Wilson about Extensible Programming. The article points out that there are advantages to storing the program text in a more structured form, including being able to include diagrams or math notation in the source code.
Thursday, March 24, 2005
Whack A Mole
One could imagine looking at the fluctuations in the local energy, and using those to determine where best to adjust the trial wave function to reduce the fluctutations (side note: one would want to use psi^2 times the local energy, since fluctuations are weighted by psi^2 in the integrals). This seems similar to the game of Whack-A-Mole, where one attempts to hit mechanical moles that pop up randomly for a brief period of time. Maybe the method could be called Whack-A-Local-Energy (WHALE).
Unfortunately for my naming scheme (and fortunately for everyone else), the method described already exists, and it's called the Energy Fluctutation Potential (EFP) method. It was first described by Stephen Fahy in "Quantum Monte Carlo Methods in Physics and Chemistry" [NATO ASI Ser. C 525 101, 1999; M. P. Nightingale and C. J. Umrigar, eds]. Further papers describing the method:
- Optimal orbitals from energy fluctuations in correlated wave functions, by Fahy and Filippi
- Optimization of inhomogeneous electron correlation factors in periodic solids by Prendergast, Bevan, and Fahy
- Optimized Jastrow-Slater wave functions for ground and excited states: Application to the lowest states of ethene by Schautz and Filippi
The EFP method involves an iteration that starts with a one-body solver (HF or LDA). The resulting orbitals are used in a VMC calculation, and the fluctuations in the local energy form a extra potential that is fed back into the one-body solver to get new orbitals, and the iteration repeats until a self-consistent solution is reached.
(Name note: this paper by Umrigar and Filippi calls it the Effective Fluctuation Potential method. This paper also gives another reference I didn't put on the above list)
Sunday, March 20, 2005
Store, manage, and share your reading list
"social" part, people's bookmarks are available to everone else.
Here's my list of bookmarks. (I just started, it's not very large)
For the academic world, Richard Cameron created CiteULike. It allows assigning category tags to papers, and has the social aspect of sharing links to papers. Perhaps most importantly, it can automatically import bibliographic information from supported publishers (including arXiv) and export the information to other formats (BibTex, EndNote).
Here's my list of articles. (Once again, very small so far)
The link to CiteULike was found via Corante
I don't know whether either of these will be a useful tool for research, but it seems worthwhile to try them out. When I started grad school in 1993, I went to the library to photocopy articles. By the time I finished in 2000, I went to the library website to download articles. That seems like a large shift, but I suspect it's not just because it makes it faster and more efficient to get the articles - it's the linking, management, and annotations represented by these sorts of applications that will make a bigger change in the future.
Wednesday, March 02, 2005
MathMath
The real issue is integrating mathematics. Mozilla and derivatives can handle MathML (and IE can with a plugin), so that seems like a good route (inserting pictures is marginally okay for converting papers to HTML, but is not as good for a more interactive environment). The only problem with MathML is the rapid onset of RSI if you actually write equations with it.
There are a couple of solutions, both convert TeX or vaguely TeX-like input to MathML. They are itex2mml and AsciiMathML. The second solution seems rather nice, as it uses javascript to convert the TeX-like notation to MathML when the page loads into the browser.
For a wiki, I've been looking into MoinMoin. At first I tried hacking itex2mml into it, and it took quite a few changes to make everything proper XHTML. Then I found the page that describes integrating AsciiMathML into MoinMoin, and that was much smoother.
AsciiMathML also has a nice way of adding new symbols, that doesn't require changing the AsciiMathML.js file.
In keeping with title of this weblog, the Unicode number for hbar is 0x210F. (although it usually only appears once in a paper and is promptly set to "1") The code for adding it is
<script type="text/javascript">
AMsymbols = AMsymbols.concat([
{input:"hbar", tag:"mo", output:"\u210F", tex:"hbar"}
]);
</script>